package com.jhl.seckill.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jhl.seckill.entity.User;
import com.jhl.seckill.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("user")
public class UserController {

    @Autowired
    UserMapper userMapper;

    @RequestMapping(value = "/getUser", method = RequestMethod.POST)
    @ResponseBody
    public User findUser(String username) {
        User user = userMapper.selectOne(new QueryWrapper<User>().eq("username", username));
        return user;

    }
}
